<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div id="main">
 *
 * @package xiufanr
 * @subpackage xiufanr
 * @since xiufanr 1.0
 */
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<title><?php
	/*
	 * Print the <title> tag based on what is being viewed.
	 */
	global $page, $paged;

	wp_title( '|', true, 'right' );

	// Add the blog name.
	bloginfo( 'name' );

	// Add the blog description for the home/front page.
	$site_description = get_bloginfo( 'description', 'display' );
	if ( $site_description && ( is_home() || is_front_page() ) )
		echo " | $site_description";

	// Add a page number if necessary:
	if ( $paged >= 2 || $page >= 2 )
		echo ' | ' . sprintf( __( 'Page %s', 'xiufanr' ), max( $paged, $page ) );

	?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php
	/* We add some JavaScript to pages with the comment form
	 * to support sites with threaded comments (when in use).
	 */
	if ( is_singular() && get_option( 'thread_comments' ) )
		wp_enqueue_script( 'comment-reply' );

	/* Always have wp_head() just before the closing </head>
	 * tag of your theme, or you will break many plugins, which
	 * generally use this hook to add elements to <head> such
	 * as styles, scripts, and meta tags.
	 */
	wp_head();
?>
</head>

<body <?php body_class(); ?>>
<div id = "loginbar-bg">
<div class="loginbar">		
			<?php if (!(current_user_can('level_0'))){ ?>
			<form class="nav-login" action="<?php echo get_option('home'); ?>/wp-login.php" method="post">
			<?php _e('登录名');?>
			<input type="text" name="log" id="log" value="<?php echo wp_specialchars(stripslashes($user_login), 1) ?>" size="20" />
			<?php _e('密码');?>
			<input type="password" name="pwd" id="pwd" size="20" />
			<input type="submit" name="submit" value="<?php _e('登录');?>" class="home-logbtn" />
			<label for="rememberme"><input name="rememberme" id="rememberme" type="checkbox"  value="forever" />
				<?php _e('记住我 ');?></label><label>|</label>
			<input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
			<a href="<?php echo get_option('home');?>/wp-login.php?action=lostpassword"><?php _e(' 忘记密码?');?></a>
			</form> 
			<div class="reg-bar">
			<a href="<?php echo get_option('home');?>/wp-login.php?action=register"><?php _e(' 免费注册  ');?></a>|

			<a href="#" onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('<?php echo get_option('home');?>');return(false);"
				 onmousedown="urchinTracker('/sethp');return(true);"><?php _e('   将本站设为首页');?></a>
			</div>
			<?php }else { ?>
			<form class="nav-login">
				<div class="log-cont"><?php echo _e('您好，');?><a href="<?php echo get_option('home');?>/wp-admin/"><?php echo wt_get_user_name();?></a>
					<?php _e(' 欢迎回来!');?>
					<a href="<?php echo get_option('home');?>/wp-admin/"><?php _e(' 进入管理控制台');?></a><?php _e(' |  ');?>
					<a href="<?php echo wp_logout_url(get_bloginfo('url')); ?>"> 	<?php _e('退出');?></a>
			</div></form>
			<div class="reg-bar">
			<a href="#" onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('<?php echo get_option('home');?>');return(false);"
				 onmousedown="urchinTracker('/sethp');return(true);"><?php _e('   将本站设为首页');?></a>
			</div>	
			<?php }?> 
			</div><!--loginbar-->
</div><!--loginbar-bg-->
<div id="wrapper" class="hfeed">
	<div id="header">
		
		<div id="masthead">
			<div id="logo">
				<h1><a href="<?php echo get_option('home'); ?>/">
						<span><?php bloginfo('name'); ?></span>
					 </a></h1>
			</div><!-- #logo -->
			
			<div id="search">
			<?php get_search_form(); ?>
			</div>
			<div id="access" role="navigation">
			  <?php /*  Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
				<div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'xiufanr' ); ?>"><?php _e( 'Skip to content', 'xiufanr' ); ?></a></div>
				<?php /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu.  The menu assiged to the primary position is the one used.  If none is assigned, the menu with the lowest ID is used.  */ ?>
				<div id='navbar'>
					<div id='navbarright'>
						<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'menu_id' => 'nav', 'before' => '<span>', 'after' => '</span>', 'theme_location' => 'primary'  ) ); ?>
					</div>
				</div><!-- #navbar -->
			</div><!-- #access -->
		</div><!-- #masthead -->
	</div><!-- #header -->
	<div class = "clear"></div>
	<div id="main">
